import { request, config } from '../utils'
const { api } = config
const { fans,fansgroup,group,tag } = api

export async function query (params) {
  return request({
    url: fans,
    method: 'get',
    data: params,
  })
}

export async function create (params) {
  debugger
  return request({
    url: fans.replace('/:id', '/save'),
    method: 'post',
    data: params,
  })
}

export async function remove (params) {
  return request({
    url: fans,
    method: 'delete',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: fans,
    method: 'patch',
    data: params,
  })
}

// 创建组
export async function createGroup (params) {
  return request({
    url: group+"/save",
    method: 'post',
    data: params,
  })
}

// 获取所有组
export async function listAllGroups (params) {
  return request({
    url: group+"/listAll",
    method: 'post',
    data: params,
  })
}

// 创建标签
export async function createTag (params) {
  return request({
    url: tag+"/save",
    method: 'post',
    data: params,
  })
}

// 获取所有标签
export async function listAllTags (params) {
  return request({
    url: tag+"/listAll",
    method: 'post',
    data: params,
  })
}
